<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="./react.js"></script>
    <script src="./react-dom.js"></script>
    <script src="./browser.min.js"></script>
    <script src="http://www.jq22.com/jquery/jquery-1.10.2.js"></script>
</head>
<body>
    <div id="example"></div>




    <script type="text/babel">

        var Ajax = React.createClass({
            getInitialState : function () {
                return {username : "~", password : "~"}
            },
            componentDidMount : function () {
                $.get(this.props.url, function (data) {
                    console.log(data);
                    this.setState({username:data.username,password:data.password});
                }.bind(this));
            },
            render : function () {
                return (
                    <div>
                        <div>username : {this.state.username}</div>
                        <div>password : {this.state.password}</div>
                    </div>
                );


            }
        });





        ReactDOM.render(<Ajax url="../3.json"/>, document.getElementById("example"));

    </script>






</body>
</html>